/*
Copyright (C) 2018-2019 de4dot@gmail.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#if ENCODER
using System;

namespace Iced.Intel.EncoderInternal {
	// GENERATOR-BEGIN: DisplSize
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum DisplSize {
		None,
		Size1,
		Size2,
		Size4,
		Size8,
		RipRelSize4_Target32,
		RipRelSize4_Target64,
	}
	// GENERATOR-END: DisplSize

	// GENERATOR-BEGIN: ImmSize
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum ImmSize {
		None,
		Size1,
		Size2,
		Size4,
		Size8,
		/// <summary><c>ENTER xxxx,yy</c></summary>
		Size2_1,
		/// <summary><c>EXTRQ/INSERTQ xx,yy</c></summary>
		Size1_1,
		/// <summary><c>CALL16 FAR x:y</c></summary>
		Size2_2,
		/// <summary><c>CALL32 FAR x:y</c></summary>
		Size4_2,
		RipRelSize1_Target16,
		RipRelSize1_Target32,
		RipRelSize1_Target64,
		RipRelSize2_Target16,
		RipRelSize2_Target32,
		RipRelSize2_Target64,
		RipRelSize4_Target32,
		RipRelSize4_Target64,
		SizeIbReg,
		Size1OpCode,
	}
	// GENERATOR-END: ImmSize

	// GENERATOR-BEGIN: EncoderFlags
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum EncoderFlags : uint {
		None = 0x00000000,
		B = 0x00000001,
		X = 0x00000002,
		R = 0x00000004,
		W = 0x00000008,
		ModRM = 0x00000010,
		Sib = 0x00000020,
		REX = 0x00000040,
		P66 = 0x00000080,
		P67 = 0x00000100,
		/// <summary><c>EVEX.R&apos;</c></summary>
		R2 = 0x00000200,
		Broadcast = 0x00000400,
		HighLegacy8BitRegs = 0x00000800,
		Displ = 0x00001000,
		PF0 = 0x00002000,
		RegIsMemory = 0x00004000,
		VvvvvShift = 0x0000001B,
		VvvvvMask = 0x0000001F,
	}
	// GENERATOR-END: EncoderFlags

	// GENERATOR-BEGIN: OperandSize
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum OperandSize {
		None,
		Size16,
		Size32,
		Size64,
	}
	// GENERATOR-END: OperandSize

	// GENERATOR-BEGIN: AddressSize
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum AddressSize {
		None,
		Size16,
		Size32,
		Size64,
	}
	// GENERATOR-END: AddressSize

	// GENERATOR-BEGIN: LegacyOpCodeTable
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum LegacyOpCodeTable {
		Normal,
		Table0F,
		Table0F38,
		Table0F3A,
	}
	// GENERATOR-END: LegacyOpCodeTable

#if !NO_VEX
	// GENERATOR-BEGIN: VexOpCodeTable
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum VexOpCodeTable {
		Table0F = 1,
		Table0F38,
		Table0F3A,
	}
	// GENERATOR-END: VexOpCodeTable
#endif

#if !NO_XOP
	// GENERATOR-BEGIN: XopOpCodeTable
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum XopOpCodeTable {
		XOP8,
		XOP9,
		XOPA,
	}
	// GENERATOR-END: XopOpCodeTable
#endif

#if !NO_EVEX
	// GENERATOR-BEGIN: EvexOpCodeTable
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum EvexOpCodeTable {
		Table0F = 1,
		Table0F38,
		Table0F3A,
	}
	// GENERATOR-END: EvexOpCodeTable
#endif

	// GENERATOR-BEGIN: Encodable
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum Encodable {
		Any,
		Only1632,
		Only64,
	}
	// GENERATOR-END: Encodable

#if !NO_VEX
	// GENERATOR-BEGIN: VexVectorLength
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum VexVectorLength {
		LZ,
		L0,
		L1,
		L128,
		L256,
		LIG,
	}
	// GENERATOR-END: VexVectorLength
#endif

#if !NO_XOP
	// GENERATOR-BEGIN: XopVectorLength
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum XopVectorLength {
		L128,
		L256,
		L0,
		L1,
	}
	// GENERATOR-END: XopVectorLength
#endif

#if !NO_EVEX
	// GENERATOR-BEGIN: EvexVectorLength
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum EvexVectorLength {
		L128,
		L256,
		L512,
	}
	// GENERATOR-END: EvexVectorLength
#endif

	// GENERATOR-BEGIN: EncFlags1
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum EncFlags1 : uint {
		EncodingShift = 0x00000000,
		EncodingMask = 0x00000007,
		OpCodeShift = 0x00000010,
	}
	// GENERATOR-END: EncFlags1

	// GENERATOR-BEGIN: LegacyFlags3
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum LegacyFlags3 : uint {
		OpMask = 0x0000007F,
		Op0Shift = 0x00000000,
		Op1Shift = 0x00000007,
		Op2Shift = 0x0000000E,
		Op3Shift = 0x00000015,
	}
	// GENERATOR-END: LegacyFlags3

#if !NO_VEX
	// GENERATOR-BEGIN: VexFlags3
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum VexFlags3 : uint {
		OpMask = 0x0000003F,
		Op0Shift = 0x00000000,
		Op1Shift = 0x00000006,
		Op2Shift = 0x0000000C,
		Op3Shift = 0x00000012,
		Op4Shift = 0x00000018,
	}
	// GENERATOR-END: VexFlags3
#endif

#if !NO_XOP
	// GENERATOR-BEGIN: XopFlags3
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum XopFlags3 : uint {
		OpMask = 0x0000001F,
		Op0Shift = 0x00000000,
		Op1Shift = 0x00000005,
		Op2Shift = 0x0000000A,
		Op3Shift = 0x0000000F,
	}
	// GENERATOR-END: XopFlags3
#endif

#if !NO_EVEX
	// GENERATOR-BEGIN: EvexFlags3
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum EvexFlags3 : uint {
		OpMask = 0x0000003F,
		Op0Shift = 0x00000000,
		Op1Shift = 0x00000006,
		Op2Shift = 0x0000000C,
		Op3Shift = 0x00000012,
	}
	// GENERATOR-END: EvexFlags3
#endif

	// GENERATOR-BEGIN: AllowedPrefixes
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum AllowedPrefixes {
		None,
		Bnd,
		BndNotrack,
		HintTakenBnd,
		Lock,
		Rep,
		RepRepne,
		XacquireXreleaseLock,
		Xrelease,
	}
	// GENERATOR-END: AllowedPrefixes

#if !NO_VEX || !NO_EVEX || !NO_XOP
	// GENERATOR-BEGIN: WBit
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum WBit : uint {
		W0,
		W1,
		WIG,
		WIG32,
	}
	// GENERATOR-END: WBit
#endif

	// GENERATOR-BEGIN: LegacyFlags
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum LegacyFlags : uint {
		MandatoryPrefixByteMask = 0x00000003,
		MandatoryPrefixByteShift = 0x00000000,
		LegacyOpCodeTableMask = 0x00000003,
		LegacyOpCodeTableShift = 0x00000002,
		EncodableMask = 0x00000003,
		EncodableShift = 0x00000004,
		HasGroupIndex = 0x00000040,
		GroupShift = 0x00000007,
		AllowedPrefixesMask = 0x0000000F,
		AllowedPrefixesShift = 0x0000000A,
		Fwait = 0x00004000,
		HasMandatoryPrefix = 0x00008000,
		OperandSizeMask = 0x00000003,
		OperandSizeShift = 0x00000010,
		AddressSizeMask = 0x00000003,
		AddressSizeShift = 0x00000012,
	}
	// GENERATOR-END: LegacyFlags

#if !NO_VEX
	// GENERATOR-BEGIN: VexFlags
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum VexFlags : uint {
		MandatoryPrefixByteMask = 0x00000003,
		MandatoryPrefixByteShift = 0x00000000,
		VexOpCodeTableMask = 0x00000003,
		VexOpCodeTableShift = 0x00000002,
		EncodableMask = 0x00000003,
		EncodableShift = 0x00000004,
		HasGroupIndex = 0x00000040,
		GroupShift = 0x00000007,
		VexVectorLengthMask = 0x00000007,
		VexVectorLengthShift = 0x0000000A,
		WBitMask = 0x00000003,
		WBitShift = 0x0000000D,
	}
	// GENERATOR-END: VexFlags
#endif

#if !NO_XOP
	// GENERATOR-BEGIN: XopFlags
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum XopFlags : uint {
		MandatoryPrefixByteMask = 0x00000003,
		MandatoryPrefixByteShift = 0x00000000,
		XopOpCodeTableMask = 0x00000003,
		XopOpCodeTableShift = 0x00000002,
		EncodableMask = 0x00000003,
		EncodableShift = 0x00000004,
		HasGroupIndex = 0x00000040,
		GroupShift = 0x00000007,
		XopVectorLengthMask = 0x00000003,
		XopVectorLengthShift = 0x0000000A,
		WBitMask = 0x00000003,
		WBitShift = 0x0000000C,
	}
	// GENERATOR-END: XopFlags
#endif

#if !NO_EVEX
	// GENERATOR-BEGIN: EvexFlags
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum EvexFlags : uint {
		MandatoryPrefixByteMask = 0x00000003,
		MandatoryPrefixByteShift = 0x00000000,
		EvexOpCodeTableMask = 0x00000003,
		EvexOpCodeTableShift = 0x00000002,
		EncodableMask = 0x00000003,
		EncodableShift = 0x00000004,
		HasGroupIndex = 0x00000040,
		GroupShift = 0x00000007,
		EvexVectorLengthMask = 0x00000003,
		EvexVectorLengthShift = 0x0000000A,
		WBitMask = 0x00000003,
		WBitShift = 0x0000000C,
		TupleTypeMask = 0x0000003F,
		TupleTypeShift = 0x0000000E,
		LIG = 0x00100000,
		b = 0x00200000,
		er = 0x00400000,
		sae = 0x00800000,
		k1 = 0x01000000,
		z = 0x02000000,
		NonZeroOpMaskRegister = 0x04000000,
	}
	// GENERATOR-END: EvexFlags
#endif

#if !NO_D3NOW
	// GENERATOR-BEGIN: D3nowFlags
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum D3nowFlags : uint {
		EncodableMask = 0x00000003,
		EncodableShift = 0x00000000,
	}
	// GENERATOR-END: D3nowFlags
#endif

	// GENERATOR-BEGIN: OpCodeHandlerFlags
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	[Flags]
	enum OpCodeHandlerFlags : uint {
		None = 0x00000000,
		Fwait = 0x00000001,
		DeclareData = 0x00000002,
	}
	// GENERATOR-END: OpCodeHandlerFlags

	// GENERATOR-BEGIN: LegacyOpKind
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum LegacyOpKind : byte {
		None,
		Aww,
		Adw,
		M,
		Mfbcd,
		Mf32,
		Mf64,
		Mf80,
		Mfi16,
		Mfi32,
		Mfi64,
		M14,
		M28,
		M98,
		M108,
		Mp,
		Ms,
		Mo,
		Mb,
		Mw,
		Md,
		Md_MPX,
		Mq,
		Mq_MPX,
		Mw2,
		Md2,
		Eb,
		Ew,
		Ed,
		Ed_MPX,
		Ew_d,
		Ew_q,
		Eq,
		Eq_MPX,
		Eww,
		Edw,
		Eqw,
		RdMb,
		RqMb,
		RdMw,
		RqMw,
		Gb,
		Gw,
		Gd,
		Gq,
		Gw_mem,
		Gd_mem,
		Gq_mem,
		Rw,
		Rd,
		Rq,
		Sw,
		Cd,
		Cq,
		Dd,
		Dq,
		Td,
		Ib,
		Ib16,
		Ib32,
		Ib64,
		Iw,
		Id,
		Id64,
		Iq,
		Ib21,
		Ib11,
		Xb,
		Xw,
		Xd,
		Xq,
		Yb,
		Yw,
		Yd,
		Yq,
		wJb,
		dJb,
		qJb,
		Jw,
		wJd,
		dJd,
		qJd,
		Jxw,
		Jxd,
		Jdisp16,
		Jdisp32,
		Ob,
		Ow,
		Od,
		Oq,
		Imm1,
		B,
		BMq,
		BMo,
		MIB,
		N,
		P,
		Q,
		RX,
		VX,
		WX,
		rDI,
		MRBX,
		ES,
		CS,
		SS,
		DS,
		FS,
		GS,
		AL,
		CL,
		AX,
		DX,
		EAX,
		RAX,
		ST,
		STi,
		r8_rb,
		r16_rw,
		r32_rd,
		r64_ro,
	}
	// GENERATOR-END: LegacyOpKind

#if !NO_VEX
	// GENERATOR-BEGIN: VexOpKind
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum VexOpKind : byte {
		None,
		Ed,
		Eq,
		Gd,
		Gq,
		RdMb,
		RqMb,
		RdMw,
		RqMw,
		Rd,
		Rq,
		Hd,
		Hq,
		HK,
		HX,
		HY,
		Ib,
		I2,
		Is4X,
		Is4Y,
		Is5X,
		Is5Y,
		M,
		Md,
		MK,
		rDI,
		RK,
		RX,
		RY,
		VK,
		VM32X,
		VM32Y,
		VM64X,
		VM64Y,
		VX,
		VY,
		WK,
		WX,
		WY,
	}
	// GENERATOR-END: VexOpKind
#endif

#if !NO_XOP
	// GENERATOR-BEGIN: XopOpKind
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum XopOpKind : byte {
		None,
		Ed,
		Eq,
		Gd,
		Gq,
		Rd,
		Rq,
		Hd,
		Hq,
		HX,
		HY,
		Ib,
		Id,
		Is4X,
		Is4Y,
		VX,
		VY,
		WX,
		WY,
	}
	// GENERATOR-END: XopOpKind
#endif

#if !NO_EVEX
	// GENERATOR-BEGIN: EvexOpKind
	// ⚠️This was generated by GENERATOR!🦹‍♂️
	enum EvexOpKind : byte {
		None,
		Ed,
		Eq,
		Gd,
		Gq,
		RdMb,
		RqMb,
		RdMw,
		RqMw,
		HX,
		HY,
		HZ,
		HXP3,
		HZP3,
		Ib,
		M,
		Rd,
		Rq,
		RX,
		RY,
		RZ,
		RK,
		VM32X,
		VM32Y,
		VM32Z,
		VM64X,
		VM64Y,
		VM64Z,
		VK,
		VKP1,
		VX,
		VY,
		VZ,
		WX,
		WY,
		WZ,
	}
	// GENERATOR-END: EvexOpKind
#endif
}
#endif
